<?php
/*
* Kusht Mud.
* ----
* The MIT License
* Copyright (c) 2010 Andrew Tutt
* ----
*/

/* Kusht Vars
*
* All of the Game-Specific Variables (These are Global, non-Dynamic)
*/

/* The decision was made very early that everything, if Enumerable (within reason) would be set with All_Flags in BaseObject and
*  Not with it's own inner variable. This decision was made for 4 reasons: (1) ease/simplicity, (2) flexibility (3) reliability
*  (4) The loss in execution speed is, in fact, zero, thanks to our efficient implementation of extended bits.
*
*  Thus, Every Variable Dealing with an Object Flag, Option, Setting, or Anything in-between should be set with a unique ID. 
*  These ids are processed as a variable-length "Bit array" that goes into BaseObject's all_flags field. 
*  Because they are linearly independent, any flag can be switched on and off without affecting any other
*  flags. Flags CAN be compared as if they are greater than and less than each other, as long as their IDs are monotonically increasing or decreasing
*  (just as one would expect), since they can of course be back-converted to their ID for comparison operations.

*  To set a variable as part of the global id's, simply use $Flag++ */

$Flag = 1;

/* A Note About Bits */
/* On a 32-Bit System, the Maximum Shift (<<) of a single 4-Byte Int that is still useful is 1 << 30 (so 31 options + '0' for 32 available states). 
*  However, the BIT Functions IS_SET, SET_BIT, and RMV_BIT are overloaded to support bit Arrays. So for an 8-Byte Array the number of available
*  states is 31 + 31 = 62, for a 12-Byte it's 93, etc. 

*  But this is all handled automatically, so add as many flags as you like.

*/

/*
 * Game parameters.
 */
// define("MAX_SKILL",		90); We have no limit on how many skills can be learned...
define("MAX_LEVEL",		40);

/*
 * Game Timing -- Right now we measure soley in seconds. Fractions are A'ok
 */


/* RESERVED GAME DEFAULT VALUES */
define("DEF_NEG",   -1);
define("INFINITE",	-1);

/* TIMEKEEPING */
define("SEC",		1);
define("MIN",		60);
define("HOUR",		3600);
define("DAY",		86400);

/* DATA FORMAT PACKAGING VARS */
define("GENERAL_MSG",   "general_msg");
define("NO_CLEAR",  	"no_clear");
define("GAME_TITLE",    "game_title");

/* For Exotic Game Fontss */
// Levels are 1 to 3
define("SAXON_LEVEL_1",    "saxon_level_1");
define("SAXON_LEVEL_2",    "saxon_level_2");
define("SAXON_LEVEL_3",    "saxon_level_3");

define("IN_ROOM",				"in_room");
define("VISIBLE_EXITS",			"visible_exits");
define("PEOPLE_IN_ROOM",		"people_in_room");
define("ITEMS_IN_ROOM",			"items_in_room");

/*
* Target Scope for Actions in CmdHandler
*/
define("TO_CHAR",		"to_char");
define("TO_TARG",		"to_targ");
define("TO_ROOM",		"to_room");
define("TO_NOTTARG",	"to_nottarg");

/*
* Talk Channels
*/
/* Listening Off */

define("CHANNEL_DEAF",			$Flag++); // Truly deaf. Only Emotes. 
define("CHANNEL_NOTELL",		$Flag++); // No Tells.
define("CHANNEL_NONEWBIE",		$Flag++);
define("CHANNEL_NOQUESTION",	$Flag++);
define("CHANNEL_NOAUCTION",		$Flag++);
define("CHANNEL_NOMUSIC",		$Flag++);
define("CHANNEL_NOCHAT",		$Flag++);
define("CHANNEL_NOGOSSIP",		$Flag++);
define("CHANNEL_NOSHOUT",		$Flag++);
define("CHANNEL_NOYELL",		$Flag++);
define("CHANNEL_NOHACKER",		$Flag++);
define("CHANNEL_NOIMMTALK",		$Flag++);

/* Speaking Off */
// These states disallow the action as opposed to disallowing the receipt.
define("CHANNEL_QUIET",			$Flag++); // Quiet mode means you have to be quiet too

define("PLR_NOCHANNELS",		$Flag++);
define("PLR_SILENCE",			$Flag++);
define("PLR_NO_EMOTE",			$Flag++);
define("PLR_NO_TELL",			$Flag++);

// Serious Actions -- Deny is no login, and freeze is no commands accepted by client
define("PLR_DENY",				$Flag++);
define("PLR_FREEZE",			$Flag++);

/*
* User Options
*/
define("PLR_AUTOEXIT",		$Flag++);
define("PLR_AUTOLOOT",		$Flag++);
define("PLR_AUTOSAC",		$Flag++);
define("PLR_BLANK",			$Flag++);
define("PLR_BRIEF",			$Flag++);
define("PLR_COMBINE",		$Flag++);
define("PLR_PROMPT",		$Flag++);
define("PLR_TELNET_GA",		$Flag++);

define("PLR_THIEF",			$Flag++);
define("PLR_KILLER",		$Flag++);

/*
* Types of Exits && Objects -- Flags serve for both
*/
define("OPEN",			$Flag++); // i.e. Unset (Check if Not Closed Instead);
define("MUST_CLIMB",	$Flag++);
define("IS_DOOR",		$Flag++);
define("CLOSED", 		$Flag++);
define("LOCKED", 		$Flag++);
define("BASH_PROOF",	$Flag++); // For the Strong
define("KNOCK_PROOF",	$Flag++); // Magic Spell
define("PICK_PROOF", 	$Flag++);

/*
* Common Exits
*/
// Syntax is: ExitName, ExitCommand, ModifierSelf, ModifierOthers
// where ModifierSelf is like "You walk into" vs. "You walk"
define("NORTH",			0);
define("SOUTH",			1);
define("EAST",			2);
define("WEST",			3);
define("UP",			4);
define("DOWN",			5);
define("GO",			6);
define("ENTER",			7);
define("LEAVE",			8);
define("EXIT_",			9);

/*
 * Sex.
 */
define("NOGENDER",	$Flag++);
define("MALE", 		$Flag++);
define("FEMALE", 	$Flag++);


/*
 * Positions.
 */
define("DEAD", 		$Flag++);
define("MORTAL", 	$Flag++);
define("INCAP", 	$Flag++);
define("STUNNED", 	$Flag++);
define("SLEEPING",  $Flag++);
define("RESTING", 	$Flag++);
define("FIGHTING", 	$Flag++);
define("STANDING", 	$Flag++);

/*
 * Conditions.
 */
define("DRUNK", 	$Flag++);
define("FULL",	 	$Flag++);
define("THIRSTY", 	$Flag++);

/*
*  Sizes -> Potentially for use with containers
*/
define("COIN",		$Flag++); // All you can fit in your tiny coin purse are coins
define("TINY",		$Flag++); // But you can't stick them in your small pack because they'll
define("SMALL",		$Flag++); // Just be floating around in there.
define("MEDIUM",	$Flag++);
define("BIG",		$Flag++);
define("HUGE",		$Flag++);
define("MASSIVE",	$Flag++);
define("IMMENSE",	$Flag++);

/* -- NOTE: THE CONSTANTS BELOW -- */
// They abide by our convention of using "Natural Language"
// whenever possible. Is it really ever going to happen that we will ever
// need to distinguish the "room_light" from the "item_light"?
// They are restricted to completely different Object types.

/*
 * Bits for 'affected_by'.
 */
define("HOLYLIGHT",		$Flag++);
define("BLINDED",		$Flag++);
define("DEAF",			$Flag++); // This is a temporary/possibly permanent flag (like truly going deaf or having a bomb go off near you)
define("MUTED",			$Flag++); // Lost voice

define("INVISIBLE",			$Flag++);
define("DETECT_EVIL",	$Flag++);
define("DETECT_INVIS",	$Flag++);
define("DETECT_MAGIC",	$Flag++);
define("DETECT_HIDDEN",	$Flag++);

define("SANCTUARIED",	$Flag++);
define("FAERIE_FIRED",	$Flag++);
define("INFRARED",		$Flag++);
define("CURSED",		$Flag++);

define("POISONED",		$Flag++);
define("PROTECTED",		$Flag++);

define("SNEAKING",		$Flag++);
define("HIDING",		$Flag++);
define("FORCED_SLEEP",	$Flag++);
define("CHARMED",		$Flag++);
define("FLYING",		$Flag++);
define("PASS_DOOR",		$Flag++);

/*
 *	Item Types
 */
define("LIGHT",           $Flag++);
define("SCROLL",          $Flag++);
define("WAND",            $Flag++);
define("STAFF",           $Flag++);
define("WEAPON",          $Flag++);
define("TREASURE",        $Flag++);
define("ARMOR",           $Flag++);
define("POTION",          $Flag++);
define("FURNITURE",       $Flag++);
define("TRASH",           $Flag++);
define("CONTAINER",       $Flag++);
define("DRINK_CON",       $Flag++);
define("KEY",             $Flag++);
define("FOOD",            $Flag++);
define("MONEY",           $Flag++);
define("BOAT",            $Flag++);
define("NPC_CORPSE",      $Flag++);
define("PC_CORPSE",		  $Flag++);
define("FOUNTAIN",        $Flag++);
define("PILL",            $Flag++);
	
/*
 * Extra flags.
 */
define("GLOWING",		$Flag++);
define("HUMMING",		$Flag++);
define("DARK",			$Flag++);
//define("LOCK",			$Flag++);
define("EVIL",			$Flag++);
//define("INVIS",			$Flag++);
define("MAGIC",			$Flag++);
define("NOT_DROPPABLE",	$Flag++);
define("BLESSED",		$Flag++);
define("ANTI_GOOD",		$Flag++);
define("ANTI_EVIL",		$Flag++);
define("ANTI_NEUTRAL",	$Flag++);
define("NOT_REMOVEABLE",$Flag++);
define("INVENTORY",		$Flag++);

// Even more Flags
define("BROKEN",		$Flag++);

/*
 * Wear flags. (We favor unset bits) (items have these)
 */
// We favor a force-flag policy -- you have to opt the functionality in
define("NOT_TAKEABLE",		$Flag++);
define("WORN_ON_FINGER",	$Flag++);
define("WORN_ON_NECK",		$Flag++);
define("WORN_ON_BODY",		$Flag++);
define("WORN_ON_HEAD",		$Flag++);
define("WORN_ON_LEGS",		$Flag++);
define("WORN_ON_FEET",		$Flag++);
define("WORN_ON_HANDS",		$Flag++);
define("WORN_ON_ARMS",		$Flag++);
define("WORN_AS_SHIELD",	$Flag++);
define("WORN_ABOUT",		$Flag++);
define("WORN_ON_WAIST",		$Flag++);
define("WORN_ON_WRIST",		$Flag++);
define("WIELDABLE",			$Flag++);
define("HOLDABLE",			$Flag++);

/*
* Hardpoints
*/
define("WEAR_NONE",			$Flag++);
define("AS_LIGHT",			$Flag++);
define("LEFT_FINGER",		$Flag++);
define("RIGHT_FINGER",		$Flag++);
define("NECK",				$Flag++);
define("BODY",				$Flag++);
define("HEAD",				$Flag++);
define("HANDS",				$Flag++);
define("ARMS",				$Flag++);
define("ABOUT_BODY",		$Flag++);
define("WAIST",				$Flag++);
define("LEFT_WRIST",		$Flag++);
define("RIGHT_WRIST",		$Flag++);
define("IN_LEFT_HAND",		$Flag++);
define("IN_RIGHT_HAND",		$Flag++);
define("MAX_WEAR",			$Flag++);

/*
 * Damage Types
 */
define("HIT",			0);
define("SLICE",			1);
define("STAB",			2);
define("SLASH",			3);
define("WHIP",			4);
define("CLAW",			5);
define("BLAST",			6);
define("POUND",			7);
define("CRUSH",			8);
define("GRIP",			9);
define("BITE",			10);
define("PIERCE",		11);
define("SUCTION",		12);




/*
 * Sector types.
 */
define("INSIDE",		$Flag++);
define("CITY",			$Flag++);
define("FIELD",			$Flag++);
define("FOREST",		$Flag++);
define("HILLS",			$Flag++);
define("MOUNTAIN",		$Flag++);
define("WATER_SWIM",	$Flag++);
define("WATER_NOSWIM",	$Flag++);
define("UNUSED",		$Flag++);
define("AIR",			$Flag++);
define("DESERT",		$Flag++);
define("MAX",			$Flag++);

/*
* More Room Flags
*/

define("NO_MOB",		$Flag++);
define("INDOORS",		$Flag++);
define("PRIVATE",		$Flag++);
define("SAFE",			$Flag++);
define("SOLITARY",		$Flag++);
define("PET_SHOP",		$Flag++);
define("NO_RECALL",		$Flag++);

/*
 * Apply types (for affects).
 */
// Note that a lot of these are, in fact, unused (Even in Diku)
define("MOD_NONE",				$Flag++);
define("MOD_BLK",				$Flag++); // Bulk (Killing things with weapons)
define("MOD_INT",				$Flag++); // Intelligence (increases slowly over time if devoted)
define("MOD_ING",				$Flag++); // Ingenuity (solving puzzles)
define("MOD_SPD",				$Flag++); // Speed 
define("MOD_MAG",				$Flag++); // Magnetism
define("MOD_CNX",				$Flag++); // Connections (paying)
define("MOD_SEX",				$Flag++);
define("MOD_CLASS",				$Flag++);
define("MOD_LEVEL",				$Flag++);
define("MOD_AGE",				$Flag++);
define("MOD_HEIGHT",			$Flag++);
define("MOD_WEIGHT",			$Flag++);
define("MOD_MANA",				$Flag++);
define("MOD_HIT",				$Flag++);
define("MOD_MOVE",				$Flag++);
define("MOD_GOLD",				$Flag++);
define("MOD_EXP",				$Flag++);
define("MOD_AC",				$Flag++);
define("MOD_HITROLL",			$Flag++);
define("MOD_DAMROLL",			$Flag++);
define("MOD_SAVING_PARA",		$Flag++);
define("MOD_SAVING_ROD",		$Flag++);
define("MOD_SAVING_PETRI",		$Flag++);
define("MOD_SAVING_BREATH",		$Flag++);
define("MOD_SAVING_SPELL",		$Flag++);

// RACES (Which in Mythica are Origins, but whatever)
define("FRESIEN", 	$Flag++);		
define("WARISH", 	$Flag++);
define("HANIARD", 	$Flag++);
define("PENCHAN",	$Flag++);

define("POOR_BACKGROUND", $Flag++);

// Special Character Flags
define("IMMORTAL",	$Flag++);
define("HERO",		$Flag++);

//echo "Flags: ".$Flag."\n";

?>